Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable UMOD optimization for x64 #68091

Merged
merged 1 commit into from
May 11, 2022
Merged

Conversation

TIHan
Copy link
Contributor

@TIHan TIHan commented Apr 15, 2022

Description

We added an optimization for GT_UMOD in ARM64. This PR enables the same optimization for x64.

Acceptance Criteria

  • Passes CI

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Apr 15, 2022
@ghost ghost assigned TIHan Apr 15, 2022
@ghost
Copy link

ghost commented Apr 15, 2022

Tagging subscribers to this area: @JulieLeeMSFT
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

We added an optimization for GT_UMOD in ARM64. This PR enables the same optimization for x64.

Acceptance Criteria

  • Passes CI
Author: TIHan
Assignees: TIHan
Labels:

area-CodeGen-coreclr

Milestone: -

@TIHan
Copy link
Contributor Author

TIHan commented Apr 16, 2022

@kunalspathak @jakobbotsch This is ready.

This is a trivial change and the diffs look good; though there are not very many of them.

@kunalspathak
Copy link
Member

though there are not very many of them.

Do you know why? I am asking to make sure that we know if these changes are good enough to catch the scenarios or did we miss something.

@kunalspathak
Copy link
Member

You can probably take some methods that were improved in arm64 work and not in x64 and then compare what make us generate differently?

@TIHan
Copy link
Contributor Author

TIHan commented Apr 18, 2022

I think the reason is that this optimization also happens in lowering for x64 where as for ARM64 it does not: https://github.com/dotnet/runtime/blob/main/src/coreclr/jit/lower.cpp#L5556

@kunalspathak
Copy link
Member

I think the reason is that this optimization also happens in lowering for x64 where as for ARM64 it does not: https://github.com/dotnet/runtime/blob/main/src/coreclr/jit/lower.cpp#L5556

So we were covering x64 but just missed few opportunities that we are also covering with this PR. Is that the case? Wonder what prohibited us from covering those scenarios in x64 prior to your PR.

@TIHan
Copy link
Contributor Author

TIHan commented Apr 21, 2022

So we were covering x64 but just missed few opportunities that we are also covering with this PR. Is that the case?

That was my thinking. It's similar to SubMulDiv optimization for 'mod' since that exists in both morph and lowering.

Wonder what prohibited us from covering those scenarios in x64 prior to your PR.

Probably just low hanging fruit.

@TIHan
Copy link
Contributor Author

TIHan commented May 11, 2022

@kunalspathak is there anything that needs to be done in this PR?

Copy link
Member

@kunalspathak kunalspathak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Sorry, I forgot to sign off.

@TIHan
Copy link
Contributor Author

TIHan commented May 11, 2022

No worries thank you! :)

@TIHan TIHan merged commit 5975649 into dotnet:main May 11, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jun 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants